View Issue Details

IDProjectCategoryView StatusLast Update
0001264T99X171.00 SKB EagleSW Issuepublic2021-12-23 17:42
Reporter(ALTech) Younkwang Jung Assigned To(SW) Kerwin Chen Due Date
PrioritynormalSeveritys2-severeReproducibilityhave not tried
Status closedResolutionfixed 
Summary0001264: [Smart3][BTF] Audio Dropout issue after BT connection
DescriptionHi Kerwin

While listening to audio after connecting BT speaker device, dropout issue was observed.

I attached the log.
The issue's occurrence time is 14:37, and it may have occurred before that.

Please let me know if there are any suspicious issues or causes.
Thank you.
YK.Jung
TagsNo tags attached.
Attach Tags

Users monitoring this issue

User List (ALTech) JunGyu Kim , (ALTech) SY Yoon , (SW) Brent Choi , (SW) Jerry Lin

Activities

(ALTech) Younkwang Jung

2021-06-07 07:52

developer  

BT_audio_dropout.7z (4,208,279 bytes)

(SW) Jim Chen

2021-06-08 14:19

developer   ~0007393

net yet find the root cause, here's some memos:
1. no underrun arround 14:37
2. SSMPoller: E#3204 parser error isn't special
3. tm_read_rssi_cb: device: 05:a9:b1:16:0a:52, rssi value = 0 at 14:36 and 14:38, but some negative values at 14:37

(SW) Jim Chen

2021-06-10 16:28

developer   ~0007432

Hi Mr. Younkwang,
I can't find some clue from the log,
only that the rssi is a little bit lower at 14:37 but I don't think that's the cause.
Could we monitor this issue and maybe check the rssi value when it happen next time?

(ALTech) Younkwang Jung

2021-06-10 17:46

developer   ~0007433

Hi Jim Chen

Okay, we'll do a little more testing on this issue.
I'll update you again when I get an additional log next time.

Thank you
YK.Jung

(ALTech) Younkwang Jung

2021-06-25 15:20

developer   ~0007555

Last edited: 2021-06-25 16:18

View 2 revisions

Hi Jim Chen

A similar issue has been reported at VoC.
Jira link is below
https://jira.skbroadband.com/browse/BTVV-2872

- STB_MAC: d4:1b:81:fe:ab:da
- SPEAKER :  Sony / SRS-XB23

Please check it

The status of PLAY in the log is changing frequently and UNDERFLOW is occurring. please review it.
===========================================================================================================================================
06-25 13:31:54.676 D 4794 4794 BluetoothConnectionManager: [ mBluetoothReceiver ] action= .ACL_CONNECTED, SRS-XB23 , deviceBoundState= 12, conncetionState= -1
06-25 13:31:57.796 D 4794 4794 BluetoothConnectionManager: [ mBluetoothReceiver ] action= .CONNECTION_STATE_CHANGED, SRS-XB23 , deviceBoundState= 12, conncetionState= -1
06-25 13:31:57.994 D 4794 4794 BluetoothConnectionManager: [ mBluetoothReceiver ] action= .BOND_STATE_CHANGED, SRS-XB23 , deviceBoundState= 11, conncetionState= -1
06-25 13:31:58.044 D 4794 4794 BluetoothConnectionManager: [ mBluetoothReceiver ] action= .PAIRING_REQUEST, SRS-XB23 , deviceBoundState= 11, conncetionState= -1
06-25 13:32:00.661 D 4794 4794 BluetoothConnectionManager: [ mBluetoothReceiver ] action= .BOND_STATE_CHANGED, SRS-XB23 , deviceBoundState= 12, conncetionState= -1
06-25 13:32:00.777 D 4794 4794 BluetoothConnectionManager: [ mBluetoothReceiver ] action= .CONNECTION_STATE_CHANGED, SRS-XB23 , deviceBoundState= 12, conncetionState= -1
06-25 13:32:00.970 I 3941 4459 A2dpStateMachine: Connected: started playing: 98:52:3D:56:F2:80
06-25 13:32:00.970 D 3941 4459 A2dpStateMachine: A2DP Playing state : device: 98:52:3D:56:F2:80 State:NOT_PLAYING->PLAYING
06-25 13:32:00.998 I 3941 4459 A2dpStateMachine: Connected: stopped playing: 98:52:3D:56:F2:80
06-25 13:32:00.998 D 3941 4459 A2dpStateMachine: A2DP Playing state : device: 98:52:3D:56:F2:80 State:PLAYING->NOT_PLAYING
06-25 13:32:00.998 W 3941 4460 bt_btif_a2dp_source: btif_a2dp_source_read_callback: UNDERFLOW: ONLY READ 0 BYTES OUT OF 1024
06-25 13:32:00.998 W 3941 4460 a2dp_vendor_ldac_encoder: a2dp_ldac_encode_frames: underflow 15
06-25 13:32:01.076 E 3471 3742 audio_virtual_buf: mixer_16bit_thread underrun happens read=107664709 write=16000000 diff=91664709
06-25 13:32:01.078 I 3941 4459 A2dpStateMachine: Connected: started playing: 98:52:3D:56:F2:80
06-25 13:32:01.078 D 3941 4459 A2dpStateMachine: A2DP Playing state : device: 98:52:3D:56:F2:80 State:NOT_PLAYING->PLAYING
06-25 13:32:01.106 W 3941 4460 bt_stack: [WARNING:client_interface.cc(464)] ReadAudioData: 1024/1024 no data 10 ms
06-25 13:32:01.106 W 3941 4460 bt_btif_a2dp_source: btif_a2dp_source_read_callback: UNDERFLOW: ONLY READ 0 BYTES OUT OF 1024
06-25 13:32:01.106 W 3941 4460 a2dp_vendor_ldac_encoder: a2dp_ldac_encode_frames: underflow 15
06-25 13:32:01.126 W 3941 4460 bt_stack: [WARNING:client_interface.cc(464)] ReadAudioData: 1024/1024 no data 10 ms
06-25 13:32:01.126 W 3941 4460 bt_btif_a2dp_source: btif_a2dp_source_read_callback: UNDERFLOW: ONLY READ 0 BYTES OUT OF 1024
06-25 13:32:01.126 W 3941 4460 a2dp_vendor_ldac_encoder: a2dp_ldac_encode_frames: underflow 30
06-25 13:32:01.130 I 3941 4459 A2dpStateMachine: Connected: stopped playing: 98:52:3D:56:F2:80
06-25 13:32:01.130 D 3941 4459 A2dpStateMachine: A2DP Playing state : device: 98:52:3D:56:F2:80 State:PLAYING->NOT_PLAYING
06-25 13:32:01.209 I 3941 4459 A2dpStateMachine: Connected: started playing: 98:52:3D:56:F2:80
06-25 13:32:01.209 D 3941 4459 A2dpStateMachine: A2DP Playing state : device: 98:52:3D:56:F2:80 State:NOT_PLAYING->PLAYING
06-25 13:32:01.256 D 3812 3924 BluetoothA2dp: getCodecStatus(98:52:3D:56:F2:80)
06-25 13:32:01.260 D 3941 3957 A2dpService: getCodecStatus(98:52:3D:56:F2:80)
06-25 13:32:03.193 W 3941 4460 bt_btif_a2dp_source: btif_a2dp_source_read_callback: UNDERFLOW: ONLY READ 0 BYTES OUT OF 1024
06-25 13:32:03.194 W 3941 4460 a2dp_vendor_ldac_encoder: a2dp_ldac_encode_frames: underflow 88
06-25 13:32:03.204 W 3941 4460 bt_btif_a2dp_source: btif_a2dp_source_read_callback: UNDERFLOW: ONLY READ 0 BYTES OUT OF 1024
06-25 13:32:03.205 W 3941 4460 a2dp_vendor_ldac_encoder: a2dp_ldac_encode_frames: underflow 108
06-25 13:32:03.216 W 3941 4460 bt_btif_a2dp_source: btif_a2dp_source_read_callback: UNDERFLOW: ONLY READ 0 BYTES OUT OF 1024
06-25 13:32:03.216 W 3941 4460 a2dp_vendor_ldac_encoder: a2dp_ldac_encode_frames: underflow 117
06-25 13:32:03.234 I 3941 4459 A2dpStateMachine: Connected: stopped playing: 98:52:3D:56:F2:80
06-25 13:32:03.234 D 3941 4459 A2dpStateMachine: A2DP Playing state : device: 98:52:3D:56:F2:80 State:PLAYING->NOT_PLAYING
06-25 13:32:03.236 W 3941 4460 bt_btif_a2dp_source: btif_a2dp_source_read_callback: UNDERFLOW: ONLY READ 0 BYTES OUT OF 1024
06-25 13:32:03.236 W 3941 4460 a2dp_vendor_ldac_encoder: a2dp_ldac_encode_frames: underflow 132
06-25 13:32:06.335 I 3941 4459 A2dpStateMachine: Connected: started playing: 98:52:3D:56:F2:80
06-25 13:32:06.335 D 3941 4459 A2dpStateMachine: A2DP Playing state : device: 98:52:3D:56:F2:80 State:NOT_PLAYING->PLAYING
=================================================================================================================

Thank you
YK.Jung

(SW) Jim Chen

2021-06-29 16:51

developer   ~0007578

Hi Mr.

there's a sound-effect when moving the focus.
when it occurs, we'll see a2dp play message,
and after 3 seconds, we'll see a2dp stop message.

within a short peroid, when the audio route changes to the BT-device,
thiese stop/start message will delayed a little bit.
that's what we see in the log.

and, when we stop a2dp, underflow message shows.

a simple way to reproduce the log:
1. pair smart3 with a bt-speaker (or earphone), power off the bt-speaker
2. keep moving the focus, power on the bt-speaker
3. when bt-speaker auto connected, the log reproduced

so , I think "state change" and "underflow" is not the root cause

(SW) Jim Chen

2021-07-06 12:14

developer   ~0007610

Hi Mr.

from Brent's video, it looks like a sampling rate issue.
from the log the A2DP codec config is set to LDAC and 96KHz

D A2dpStateMachine: A2DP Codec Config: {codecName:LDAC,mCodecType:4,mCodecPriority:5001,mSampleRate:0x8(96000),mBitsPerSample:0x4(32)....

I'll check this part.
Please help to get log "android 9 pair to XB23" for me.

(SW) Jim Chen

2021-07-06 17:09

developer  

Bluetooth.apk (3,120,823 bytes)

(SW) Jim Chen

2021-07-06 17:09

developer   ~0007615

Hi Brent,
Please check if the apk fix the sound.

1. adb install -r Bluetooth.apk
2. reboot smart3
3. check the output from XB23

(SW) Jim Chen

2021-07-08 12:17

developer   ~0007625

Hi Brent,
1. adb uninstall com.android.bluetooth
2. unzip Bluetooth.7z
3. adb stuffs (connect, root, reconnect remount)
4. push 4 files (follow pushbt.sh)
5. reboot and check XB23
Bluetooth.7z (1,088,780 bytes)

(SW) Jim Chen

2021-07-08 15:27

developer   ~0007628

Hi, Mr.,
The above apk is to remove LDAC support.
Without LDAC, the A2DP codec would fallback to AAC or SBC.
And the test result was ok with XB23 (this would be the worstcase workaround solution)

Now still tracing how the codec-related-fields value assigned, especially the LDAC sampling rate.
ldac_samp_rate.png (115,622 bytes)   
ldac_samp_rate.png (115,622 bytes)   

(SW) Jim Chen

2021-07-26 15:06

developer   ~0007735

Hi Mr.
Here's the patch that could fix the issue.
it is from amlogic's newer BSP.

It looks like the data format is wrong in some condition and AML fix it by converting the format to the correct one.
In case that all the vendor share the common SDK "skb-amandroidq/aml_orig_hs30"
I suggest this patch to be applied to common SDK by amlogic

A test image is available here: /release_by_fxn/smart3_test/BTVD15920 - LDAC
Verified ok with my sony device.
When test with it, please make sure they paired with LDAC selected (check the existence of following logcat)

A2dpStateMachine: A2DP Codec Config: {codecName:LDAC,mCodecType:4,mCodecPriority:5001

(ALTech) Younkwang Jung

2021-07-26 18:56

developer  

logcat.zip (1,080,563 bytes)

(ALTech) Younkwang Jung

2021-07-26 18:56

developer   ~0007737

Hi Jim Chen

I did BT test with this FW and sony BT Speaker(SRS-XB23)
============================================================
19:41:50 BT speaker on
19:41:54 BT speaker is connected to STB
        ==> A slight audio drop occurs occasionally
        
19:44:00 BT speaker off

19:44:30 BT speaker on
19:44:35 BT speaker is connected to STB
        ==> A slight audio drop occurs occasionally
======================================================

I attached the test log information.
Please check this attached log .

Thank you
YK.Jung

(SW) Jim Chen

2021-07-28 23:11

developer   ~0007753

Hi Mr.
I'm not sure what is slight audio drop, could you capture a short video for me?

But I did hear some audio glitch when playing the 1ktone audio and powering on the BT device (about 10~20% rate)
Here's a patch also found in amlogic's newer BSP.
The 1st second audio is muted, I tried it and looks my glitch was fixed.

here's the way to update STB to include this patch,
on PC:
adb root
adb remount
adb push audio.primary.amlogic.so /vendor/lib/hw/
on STB:
killall audioserver (or reboot)
audio.primary.amlogic.so (386,308 bytes)

(ALTech) Younkwang Jung

2021-07-30 08:02

developer   ~0007766

Hi Jim

I honestly don't know if this is an issue right now.
Sometimes audio drops occur and sometimes they don't. ( audio drop occurs at a distance of 1M to 3M from STB. )
The problem is that the environment I'm testing here itself can be caused by interference because there are too many BT devices.
First of all, the QA manager will do a test at home over the weekend.
If there is an issue there, I will discuss it again then.

Thank you
YK.Jung

(ALTech) Younkwang Jung

2021-10-01 09:15

developer   ~0008351

Hi jim

Test FW : v15.531.1l ( build date : 20210930 )
During the sleep/wakeup test, audio drop issue occurred.
Even if I switch channels, audio drop continues to occur.
I attached the video file(KakaoTalk_20211001_101111607.mp4) and log file ( BFX-AT100_20211001-095834.zip )


=======================================================================
..
10-01 10:00:13.940 I 3576 8395 RendererPolicyBase_0: set_audioStrategy: AUDIO_STRATEGY_RESAMPLE ==> AUDIO_STRATEGY_DROP, diffUs:-605.062000 ms
10-01 10:00:13.940 I 3576 8395 RendererPolicyBase_0: restore audio sink speed from 1.10 to 1.00
10-01 10:00:13.959 I 3576 8395 RendererPolicyBase_0: set_audioStrategy: AUDIO_STRATEGY_DROP ==> AUDIO_STRATEGY_RESAMPLE, diffUs:-496.264000 ms
10-01 10:00:13.959 I 3576 8395 RendererPolicyBase_0: audio late than 496.26 ms, adjust audio sink speed to 1.10, factor:0.10
10-01 10:00:16.668 I 3576 8395 RendererPolicyBase_0: set_audioStrategy: AUDIO_STRATEGY_RESAMPLE ==> AUDIO_STRATEGY_DROP, diffUs:-602.397000 ms
10-01 10:00:16.668 I 3576 8395 RendererPolicyBase_0: restore audio sink speed from 1.10 to 1.00
10-01 10:00:16.691 I 3576 8395 RendererPolicyBase_0: set_audioStrategy: AUDIO_STRATEGY_DROP ==> AUDIO_STRATEGY_RESAMPLE, diffUs:-497.171000 ms
10-01 10:00:16.691 I 3576 8395 RendererPolicyBase_0: audio late than 497.17 ms, adjust audio sink speed to 1.10, factor:0.10
..
=======================================================================

Please check it
Thank you
YK.Jung

(ALTech) Younkwang Jung

2021-10-01 10:08

developer   ~0008354

Hi jim

Please put this issue on hold .
The AMLOGIC test patch is applied to this FW.
It may occur due to that,
If this issue occurs again later, I will mention it again then.

Thank you
YK.Jung

(SW) Kerwin Chen

2021-12-23 17:42

developer   ~0009077

SoC vendor fixed it

Issue History

Date Modified Username Field Change
2021-06-07 07:52 (ALTech) Younkwang Jung New Issue
2021-06-07 07:52 (ALTech) Younkwang Jung Status new => assigned
2021-06-07 07:52 (ALTech) Younkwang Jung Assigned To => (SW) Kerwin Chen
2021-06-07 07:52 (ALTech) Younkwang Jung File Added: BT_audio_dropout.7z
2021-06-07 07:52 (ALTech) Younkwang Jung Issue Monitored: (SW) Brent Choi
2021-06-07 07:52 (ALTech) Younkwang Jung Issue Monitored: (SW) Jerry Lin
2021-06-07 07:52 (ALTech) Younkwang Jung Issue Monitored: (ALTech) SY Yoon
2021-06-07 14:49 (SW) Kerwin Chen Assigned To (SW) Kerwin Chen => (SW) Jim Chen
2021-06-08 14:19 (SW) Jim Chen Note Added: 0007393
2021-06-10 16:28 (SW) Jim Chen Assigned To (SW) Jim Chen => (ALTech) Younkwang Jung
2021-06-10 16:28 (SW) Jim Chen Status assigned => feedback
2021-06-10 16:28 (SW) Jim Chen Note Added: 0007432
2021-06-10 17:46 (ALTech) Younkwang Jung Note Added: 0007433
2021-06-25 15:20 (ALTech) Younkwang Jung File Added: ME0035_20210625_d4_1b_81_fe_ab_da.zip
2021-06-25 15:20 (ALTech) Younkwang Jung Note Added: 0007555
2021-06-25 16:18 (ALTech) Younkwang Jung Note Edited: 0007555 View Revisions
2021-06-25 16:23 (ALTech) Younkwang Jung Issue Monitored: (ALTech) JunGyu Kim
2021-06-29 16:51 (SW) Jim Chen File Added: WeChat Screenshot_20210629164104.png
2021-06-29 16:51 (SW) Jim Chen Note Added: 0007578
2021-07-06 12:14 (SW) Jim Chen Note Added: 0007610
2021-07-06 17:09 (SW) Jim Chen File Added: Bluetooth.apk
2021-07-06 17:09 (SW) Jim Chen Note Added: 0007615
2021-07-08 12:17 (SW) Jim Chen File Added: Bluetooth.7z
2021-07-08 12:17 (SW) Jim Chen Note Added: 0007625
2021-07-08 15:27 (SW) Jim Chen File Added: ldac_samp_rate.png
2021-07-08 15:27 (SW) Jim Chen Note Added: 0007628
2021-07-26 15:06 (SW) Jim Chen File Added: WeChat Screenshot_20210726145424.png
2021-07-26 15:06 (SW) Jim Chen Note Added: 0007735
2021-07-26 18:56 (ALTech) Younkwang Jung File Added: logcat.zip
2021-07-26 18:56 (ALTech) Younkwang Jung Note Added: 0007737
2021-07-28 23:11 (SW) Jim Chen File Added: audio.primary.amlogic.so
2021-07-28 23:11 (SW) Jim Chen File Added: WeChat Screenshot_20210728225416.png
2021-07-28 23:11 (SW) Jim Chen Note Added: 0007753
2021-07-30 08:02 (ALTech) Younkwang Jung Note Added: 0007766
2021-10-01 09:15 (ALTech) Younkwang Jung File Added: BFX-AT100_20211001-095834.zip
2021-10-01 09:15 (ALTech) Younkwang Jung File Added: KakaoTalk_20211001_101111607.mp4
2021-10-01 09:15 (ALTech) Younkwang Jung Note Added: 0008351
2021-10-01 09:15 (ALTech) Younkwang Jung Assigned To (ALTech) Younkwang Jung => (SW) Jim Chen
2021-10-01 10:08 (ALTech) Younkwang Jung Note Added: 0008354
2021-10-01 10:08 (ALTech) Younkwang Jung Status feedback => assigned
2021-10-01 10:09 (ALTech) Younkwang Jung Assigned To (SW) Jim Chen => (ALTech) Younkwang Jung
2021-12-23 17:42 (SW) Kerwin Chen Assigned To (ALTech) Younkwang Jung => (SW) Kerwin Chen
2021-12-23 17:42 (SW) Kerwin Chen Status assigned => closed
2021-12-23 17:42 (SW) Kerwin Chen Resolution open => fixed
2021-12-23 17:42 (SW) Kerwin Chen Note Added: 0009077